<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<style type="text/css">@import url(Calendar-win2k-1.css);</style>
<script type="text/javascript" src="Calendar.js"></script>
<script type="text/javascript" src="Calendar-es.js"></script>
<script type="text/javascript" src="Calendar-setup.js"></script>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Fulbito Jueliz</title>
<style type="text/css">
body {
	background-image: url(Proxy_Grass.jpg);
}
</style>
</head>

<body>
<script>
	function Validar()
	{
	
		fecha=BuscarCancha.txtDia.value;

	
			var acumula="";
	
	    if(fecha==""){acumula+="Registre la Fecha \n";}
	
		 	if(acumula!="")
		 	{
				 alert(acumula);
			}
		 	else
		 		{
		 			document.BuscarCancha.action="<%=request.getContextPath()%>/BuscarCanchaServlet";
	//	 			document.BuscarCancha.method="Post";
	//	 			document.BuscarCancha.accion.Value="GRABAR";
		 			document.BuscarCancha.submit();
	//				location.href='Principal.jsp';
	 		}
	}
	function ValidaNumeros(){
		if(window.event.keyCode<48 || window.event.keyCode>57){
		window.event.keyCode=0;
		}
	}
	function Principal(){
		location.href='Principal.jsp';

	}
	</script>



<form id="BuscarCancha" name="BuscarCancha" method="post" action="BuscarCanchaServlet">
  <table width="868" height="183" border="1">
    <tr>
      <td colspan="3" align="center" bgcolor="#FF9933"><h1>Buscar Canchas</h1></td>
    </tr>
    <tr>
      <td colspan="3" bgcolor="#FF9933">&nbsp;</td>
    </tr>
    <tr>
      <td width="301" align="center" bgcolor="#FF9933">Distrito</td>
      <td colspan="2" bgcolor="#FF9933">

      <select name="cboDistrito">
      <option value="0">La Molina</option>
      <option value="1">Miraflores</option>
      <option value="2">Surco</option>      
      </select>
				</td>
      </td>
    </tr>
    <tr>
      <td align="center" bgcolor="#FF9933">Fecha</td>
      <td colspan="2" bgcolor="#FF9933"><input type="text" readonly="readonly" id="txtDia" name="txtDia"> <input type="button" id="trigger" value="..."></td></tr></td></tr>
    <tr>
      <td align="center" bgcolor="#FF9933">Hora de Inicio</td>
      <td colspan="2" bgcolor="#FF9933"><select name="cboHoraInicio"> 
      <option value="00">00</option> <option value="01">01</option> <option value="02">02</option> <option value="03">03</option> <option value="04">04</option> <option value="05">05</option>
      <option value="06">06</option> <option value="07">07</option> <option value="08">08</option> <option value="09">09</option> <option value="10">10</option> <option value="11">11</option>
      <option value="12">12</option> <option value="13">13</option> <option value="14">14</option> <option value="15">15</option> <option value="16">16</option> <option value="17">17</option>
      <option value="18">18</option> <option value="19">19</option> <option value="20">20</option> <option value="21">21</option> <option value="22">22</option> <option value="23">23</option>
      </select> Horas   
      <select name="cboMinutosInicio">
      <option value="00">00</option> <option value="01">01</option> <option value="02">02</option> <option value="03">03</option> <option value="04">04</option> <option value="05">05</option>
      <option value="06">06</option> <option value="07">07</option> <option value="08">08</option> <option value="09">09</option> <option value="10">10</option> <option value="11">11</option>
      <option value="12">12</option> <option value="13">13</option> <option value="14">14</option> <option value="15">15</option> <option value="16">16</option> <option value="17">17</option>
      <option value="18">18</option> <option value="19">19</option> <option value="20">20</option> <option value="21">21</option> <option value="22">22</option> <option value="23">23</option>
      <option value="24">24</option> <option value="25">25</option> <option value="26">26</option> <option value="27">27</option> <option value="28">28</option> <option value="29">29</option>
      <option value="30">30</option> <option value="31">31</option> <option value="32">32</option> <option value="33">33</option> <option value="34">34</option> <option value="35">35</option>
      <option>36</option> <option>37</option> <option>38</option> <option>39</option> <option>40</option> <option>41</option>
      <option>42</option> <option>43</option> <option>44</option> <option>45</option> <option>46</option> <option>47</option>
      <option>48</option> <option>49</option> <option>50</option> <option>51</option> <option>52</option> <option>53</option>
      <option>54</option> <option>55</option> <option>56</option> <option>57</option> <option>58</option> <option>59</option>
      </select> Minutos</td>     </td>
    </tr>
    <tr>
      <td align="center" bgcolor="#FF9933">Hora de Fin</td>
      <td colspan="2" bgcolor="#FF9933"><select name="cboHoraFin">
      <option value="00">00</option> <option value="01">01</option> <option value="02">02</option> <option value="03">03</option> <option value="04">04</option> <option value="05">05</option>
      <option value="06">06</option> <option value="07">07</option> <option value="08">08</option> <option value="09">09</option> <option value="10">10</option> <option value="11">11</option>
      <option value="12">12</option> <option value="13">13</option> <option value="14">14</option> <option value="15">15</option> <option value="16">16</option> <option value="17">17</option>
      <option value="18">18</option> <option value="19">19</option> <option value="20">20</option> <option value="21">21</option> <option value="22">22</option> <option value="23">23</option>
      </select> Horas          
      <select name="cboMinutosFin">
      <option>00</option> <option>01</option> <option>02</option> <option>03</option> <option>04</option>
      <option>05</option> <option>06</option> <option>07</option> <option>08</option> <option>09</option>
      <option>10</option> <option>11</option> <option>12</option> <option>13</option> <option>14</option>
      <option>15</option> <option>16</option> <option>17</option> <option>18</option> <option>19</option>
      <option>20</option> <option>21</option> <option>22</option> <option>23</option> <option>24</option>
      <option>25</option> <option>26</option> <option>27</option> <option>28</option> <option>29</option>
      <option>30</option> <option>31</option> <option>32</option> <option>33</option> <option>34</option>
      <option>35</option> <option>36</option> <option>37</option> <option>38</option> <option>39</option>
      <option>40</option> <option>41</option> <option>42</option> <option>43</option> <option>44</option>
      <option>45</option> <option>46</option> <option>47</option> <option>48</option> <option>49</option>
      <option>50</option> <option>51</option> <option>52</option> <option>53</option> <option>54</option>
      <option>55</option> <option>56</option> <option>57</option> <option>58</option> <option>59</option>
      </select> Minutos</td>
    </tr>
    <tr align="center">
      <td colspan="3" bgcolor="#FF9933">
     
      </td>
    </tr>
    <tr>
      <td colspan="3" bgcolor="#FF9933">&nbsp;</td>
    </tr>
    <tr>
     
      <td width="400" align="center" bgcolor="#FF9933"><input type="submit" name="btnBuscar" id="btnBuscar" value="Buscar"  style="font-weight: bold; color: white; background-color: green"/></td>
      <td width="400" align="center" bgcolor="#FF9933"><input type="button" name="btnCancelar" id="btnCancelar" value="Regresar" onclick="Principal()" style="font-weight: bold; color: white; background-color: green"/></td>
    </tr>
  </table>
</form>
<script type="text/javascript"> 
  function dateChanged(calendar) {
    if (calendar.dateClicked) {
      var y = calendar.date.getFullYear();
      var m = calendar.date.getMonth();
      var d = calendar.date.getDate();
      window.location = "BuscarCanchaServlet";
    }
  };

  Calendar.setup(
    {
      inputField  : "txtDia",
      ifFormat    : "%Y-%m-%d",
      button      : "trigger"
    }
  );
</script>



 <table border="1" cellpadding="0" cellspacing="0" bgcolor="#FF9933" style="width: 915px;  ">
  <tr>
    <th width="40" scope="col" style="width: 150px; ">Nombre de Cancha</th>
    <th width="40" scope="col" style="width: 150px; ">Caracteristicas</th>
    <th width="40" scope="col" style="width: 150px; ">Horario</th>
    <th width="40" scope="col" style="width: 150px; ">Foto</th>
    <th width="70" scope="col" style="width: 150px; ">Disponi	ble</th>
  </tr>
  
  <%@page import="java.util.*, anonymus.modelo.Cancha" %>
<%

Collection<Cancha> canchas = (ArrayList<Cancha>)request.getAttribute("Canchitas");

if(canchas != null) { 

int i = 1;

for(Cancha x : canchas) {
%>  
  <tr>
    <td><% out.print(x.getNombreCancha()); %></td>
	<td><% out.print(x.getCaracteristicasCancha()); %></td>
	<td><% out.print(x.getInicio() + " " + x.getFin()); %></td>
	<td><% out.print(x.getFoto()); %></td>

	<td><% out.print(x.getDisponible()); %></td>
  </tr>
<% }  
  } %>
 
    
  </table>
</body>
</html>
